#include <stdio.h>
#include <stdlib.h>
#include "sxml_parse.h"

//Testing
void user_callback_meta(int level, const char* meta)
{
    printf("META: %s\n", meta);
}

void user_callback_tags(int level, const char* tag)
{
    printf("TAGS: (L%d) %s\n", level, tag);
}

void user_callback_data(int level, const char* data)
{
    printf("DATA: (L%d) %s\n", level, data);
}

void user_callback_prop(int level, const char* property, const char* value)
{
    printf("PROP: (L%d) %s = %s\n", level, property, value);
}

int main(int argc, const char* argv[])
{
    if (argc != 2) {
        printf("Need input file\n");
        return -1;
    }

    sxmlInitCallback(user_callback_meta, user_callback_tags,
            user_callback_data, user_callback_prop);
    sxmlParseFromFile(argv[1]);

    return 0;
}

